home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / LPC / pragma < prev    next >
Text File  |  2001-04-06  |  3KB  |  74 lines

  1. NAME
  2.         pragma
  3.  
  4. DESCRIPTION
  5.         The preprocessor directive #pragma can be used to select
  6.         several compilation options.
  7.  
  8.         combine_strings: Perform the addition of string literals at
  9.                 compile time instead of run time, e.g. "foo"+"bar"
  10.                 will be compiled as "foobar". Like the concatenation
  11.                 of adjacent string literals ("foo" "bar" is compiled
  12.                 as "foobar" as well) already done by the preprocessor,
  13.                 the combine_strings will save memory, because the combined
  14.                 strings can be shared betweena blueprint and it's clones,
  15.                 and the strings also have a good chance to be entered
  16.                 into the global shared-string-table.
  17.         no_combine_string: Contrary to combine_strings, may be used to
  18.                 deactivate a combine_strings pragma.
  19.  
  20.         no_clone: The blueprint object can't be cloned.
  21.         no_inherit: The program can't be inherited.
  22.         no_shadow: The program can't be shadowed (similar to declaring
  23.                 all functions as 'nomask').
  24.  
  25.         weak_types: no type checking (this is the default).
  26.         strict_types: all functions must be declared with argument
  27.                 prototypes, and the return values of call_other() must
  28.                 be casted.
  29.         strong_types: all functions must be declared with complete
  30.                 types of returnvalue and parameters.
  31.         save_types: the declaration data is kept after compilation and
  32.                 checked at runtime. This is important for type-safe
  33.                 inheritance.
  34.  
  35.         verbose_errors: upon a compilation error, the driver displays
  36.                 the actual context of the errorenous text. This is
  37.                 helpful with errors within long expressions.
  38.  
  39.         no_local_scopes, local_scopes: when local scoping is turned
  40.                 off, local variables are visible even outside
  41.                 their defining blocks. The setting of this pragma is
  42.                 considered upon entry into a function only. By default,
  43.                 local scoping is on.
  44.         local_scopes: local variables are visible only inside their
  45.                 defining blocks.
  46.  
  47.         pedantic: Certain warnings are treated as errors:
  48.                 - failure to pass enough arguments to simul efuns
  49.         sloppy: Turns off pedantic (the default).
  50.         
  51.         When an object is compiled with type testing (#pragma
  52.         strict_types), all types are saved of the arguments for that
  53.         function during compilation.  If the #pragma save_types is
  54.         specified, then the types are saved even after compilation, to
  55.         be used when the object is inherited.
  56.  
  57.         The following two pragmas are available if the driver was
  58.         compiled with DEBUG and TRACE_CODE options:
  59.  
  60.         set_code_window: Sets an offset to the current program writing
  61.                 position. Use this BEFORE a piece of code where you
  62.                 want to check to what bytecodes it is compiled.
  63.         show_code_window: shows some bytes starting at or near the
  64.                 last point set_code_window was called.
  65.  
  66. HISTORY
  67.         LDMud 3.2.7 added local_scopes, no_local_scopes, no_clone
  68.         and no_inherit.
  69.         LDMud 3.2.8 added weak_types, pedantic and sloppy.
  70.  
  71. SEE ALSO
  72.         inheritance(LPC), initialisation(LPC), objects(C),
  73.         operators(LPC)
  74.